package ans.pmst_17_04;

import test.Entrance;

/**
 * #      面试题 17.04
 * 名称   消失的数字
 * 链接   https://leetcode-cn.com/problems/missing-number-lcci
 * 题解   [348](https://leetcode-cn.com/problems/missing-number-lcci/solution)
 * 通过率 64.4%
 * 难道   简单
 */

public class Solution {
    @Entrance
    public int missingNumber(int[] nums) {
        int xor = 0;
        for (int i = 0; i < nums.length; i++)
            xor ^= nums[i] ^ (i + 1);
        return xor;
    }
}